class_docstr: AliasSampleTest
      
docstr: test_speed
          
code: def test_speed(self):
      """test_speed"""
  
      num = 1000
      size = [10240, 1, 5]
      probs = np.random.uniform(0.0, 1.0, [num])
      probs /= np.sum(probs)
  
      start = time.time()
      alias, events = alias_sample_build_table(probs)
      for i in range(100):
          alias_sample(size, alias, events)
      alias_sample_time = time.time() - start
  
      start = time.time()
      for i in range(100):
          np.random.choice(num, size, p=probs)
      np_sample_time = time.time() - start
      self.assertTrue(alias_sample_time < np_sample_time)
  
file_path: PGL/legacy/pgl/tests/deepwalk/test_alias_sample.py
imports: import argparse
  import time
  import unittest
  from collections import Counter
  import numpy
  from pgl.graph_kernel import alias_sample_build_table
  from pgl.sample import alias_sample
label_desc: Use image node_id 2 for calling the AliasSampleTest obj's underlying member method code with example usage: obj.test_speed() without return types