Live data from Hacker News

Show HN: Bt – BitTorrent library in Java 8

github.com

41–50 of 89 posts

Re: Show HN: Bt – BitTorrent library in Java 8

#41
post #39
post #16

Earlier quoted context omitted.

opening and quiting vim for a file of 2500 lines of C++ (so with all the plugins and stuff) takes 0.030seconds. I don't see how you can be satisfied with 2 seconds startup for a terminal application

Well the torrent download will take a lot more than 2 seconds so that time is totally amortized. Besides this comparison looks like a total bikeshedding unless you plan on downloading torrents with vim. By the way the project looks fantastic. I'll be giving it a try. The alternative for just command line torrent on a *nix is aria2 [0]. Works exactly as advertised. [0]: https://sourceforge.net/projects/aria2/

Well there is a truth to that. However this might be something symptomatic. As power consumption is getting more and more interesting nowadays, having a minimal impact on system resources overall might still be a sensible goal.

Re: Show HN: Bt – BitTorrent library in Java 8

#44

Nice work. I'm wondering, how would you test/benchmark such an application. Besides manual testing on a variety of torrents, how would you do regression test there? same question for benchmarking. How to compare this work with another client?

I have several hundred unit tests and also a bunch of integration tests. While UTs usually test API of individual classes, each of the ITs creates a swarm of local peers and launches a torrenting session with certain conditions: seeders to leechers ratio, downloading from .torrent file vs using a magnet link, PEX enabled/disabled, encrypted vs raw message streams, etc.

Benchmarks (like in libtorrent) is something I'm looking forward to, but the project is still in the early stage -- there's a lot to be done with regards to optimization, i.e. switching to using NIO selectors, adding a caching layer, etc. That's a lot of work, and that's why I'm looking for collaborators, before investing more time into performance-tuning.

Re: Show HN: Bt – BitTorrent library in Java 8

#45

There are many great BitTorrent clients out there, yet I've made my own and willing to share and attract collaborators!

Just curious, how many hours do you think you've spent on this project?

I'd say something in the range of 500-1000 hours.

Re: Show HN: Bt – BitTorrent library in Java 8

#46

Nice work. I'm wondering, how would you test/benchmark such an application. Besides manual testing on a variety of torrents, how would you do regression test there? same question for benchmarking. How to compare this work with another client?

I have several hundred unit tests and also a bunch of integration tests. While UTs usually test API of individual classes, each of the ITs creates a swarm of local peers and launches a torrenting session with certain conditions: seeders to leechers ratio, downloading from .torrent file vs using a magnet link, PEX enabled/disabled, encrypted vs raw message streams, etc. Benchmarks (like in libtorrent) is something I'm…

I would advise against implementing a custom cache for piece data. Caching file data in-app is counterproductive because it wastes memory duplicating data which the OS already holds in its page cache. Instead memory mapped I/O should be preferred.

Re: Show HN: Bt – BitTorrent library in Java 8

#48
post #32
post #15

Earlier quoted context omitted.

Some apps just include JRE into the app package (+100MB), and just use it if it's not provided by OS. But then you need to provide different app packages for different OSes.

C, Go, and Rust would require different app packages for different OSes--that's not a problem. The problem is bundling a 100MB runtime for a CLI.

people bundle a browser for a tiny icon in your taskbar so 100MB for a runtime in a CLI isn't gonna prevent people from using it

Re: Show HN: Bt – BitTorrent library in Java 8

#49

Earlier quoted context omitted.

Just curious, how many hours do you think you've spent on this project?

I'd say something in the range of 500-1000 hours.

That's less than I was expecting. Did you study any existing library to get up to speed?
Post reply on HN